package com.gitee.wsl.doc.prosemirror.model.node


import com.gitee.wsl.doc.prosemirror.model.attr.Attrs
import com.gitee.wsl.doc.prosemirror.model.fragment.Fragment
import com.gitee.wsl.doc.prosemirror.model.mark.Mark
import com.gitee.wsl.prop.Attributes


open class BlockNode(
    // The type of node that this is.
    type: NodeType,
    // An object mapping attribute names to values. The kind of attributes allowed and required are
    // [determined](#model.NodeSpec.attrs) by the node type.
    attrs: Attrs,
    // A fragment holding the node's children.
    content: Fragment,
    // The marks (things like whether it is emphasized or part of a link) applied to this node.
    marks: List<Mark> = Mark.none,
    val styles: Attributes? = null
):Node(type=type, attrs=attrs, content = content, marks = marks){
    init {
        require( type.isBlock ){"not block type"}
    }
}